package com.bolehui.web;


import com.bolehui.base.result.Result;
import com.bolehui.domain.dto.CompanyDTO;
import com.bolehui.domain.vo.CompanyVO;
import com.bolehui.service.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chendongjie     email:chendongjie@gz.iscas.ac.cn
 * @version 1.0
 * @ClassName Company
 * @Description
 * @createTime 2025/3/7-14:44
 * Copyright (C) 2021-2022 CASEEDER, All Rights Reserved.
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 */
@RequestMapping("/company")
@RestController
public class CompanyController {

    @Autowired
    private CompanyService companyService;

    @RequestMapping(params = "action=update")
    public Result updateCompanyInfo(@RequestBody CompanyVO company, Long userId){
        Result result = companyService.saveOrUpdate(company, userId);
        return result;
    }

    @RequestMapping(params = "action=getCompanyInfo")
    public Result getCompanyInfoByUserId(Long userId){
        CompanyDTO dto = companyService.selectByUserId(userId);
        return Result.success(dto);
    }
}
